<?php
	echo validation_errors();
	echo form_open('teacher/edit_profile');
?>

Profile | <a href="/165-project/index.php/teacher/edit_profile/password">Change Password</a><br />

<h2>Teacher Profile</h2>
<?php
	echo form_label('Last Name', 'lastname'); echo "<br />";
	echo form_input('lastname', set_value('lastname', $reguser['lastname']));

	echo "<br />";
	echo form_label('First Name', 'firstname'); echo "<br />";
	echo form_input('firstname', set_value('firstname', $reguser['firstname']));

	echo "<br />";
	echo form_label('Middle Name', 'middlename'); echo "<br />";
	echo form_input('middlename', set_value('middlename', $reguser['middlename']));

	echo "<br />";
	echo form_label('Sex: ', 'sex'); echo "&nbsp;&nbsp;";
	echo form_radio('sex', 'M', $reguser['sex'] == 'M' ? TRUE : FALSE) . 'Male'; echo "&nbsp;&nbsp;";
	echo form_radio('sex', 'F', $reguser['sex'] == 'F' ? TRUE : FALSE) . 'Female';

	echo "<br />";
	echo form_label('Mobile Number', 'mobilenumber'); echo "<br />";
	echo form_input('mobilenumber', set_value('mobilenumber', $reguser['mobilenumber']));
	
	echo "<br />";
	echo form_label("Birthdate", "birthdate");
	echo "<br />";
	echo '<select id="years" name="y">';
	$i = 1940;
	while($i < 1999){
		echo "<option value='$i'>$i</option>";
		$i++;
	}
	echo '</select>';
	$months = array("January", "February", "March", "April", "May", "June",
	                "July", "August", "September", "October", "November", "December");
	$i = 0;
	
	echo '<select id="months" name="m">';
	while($i < 12){
		echo "<option value='" . $months[$i] . "'>" . $months[$i] . "</option>";
		$i++;
	}
	echo "</select>'";
	echo '<select id="dates" name="d">';
	$i = 1;
	while($i < 32){
		echo "<option value='$i'>$i</option>";
		$i++;
	}
	echo '</select>';

	echo "<br />";
	echo form_label('About Me', 'aboutme'); echo "<br />";
	echo form_textarea(array('id' => 'body' , 'name' => 'aboutme', 'cols' => '70', 'rows' => '10'), set_value('aboutme', $reguser['aboutme']));

	echo "<br />";
	echo form_label('Academic Credentials', 'academiccredentials'); echo "<br />";
	echo form_textarea(array('id' => 'body' , 'name' => 'academiccredentials', 'cols' => '70', 'rows' => '10'), set_value('academiccredentials', $reguser['academiccredentials']));
?>
<?php echo form_submit('save', "Save"); ?>
<?php echo form_close(); ?>
